<?php
$arr=[1,3,5,7,4,2];
for($i=0;$i<count($arr);$i++){
    echo $arr[$i] . '<br>';
}
echo '<hr>';

$arr1=array('haha1','haha2','heihei3','heihei4');
var_dump($arr1);
echo '<hr>';

$arr2=[
    'name'=>'tom',
    'age'=>18,
    'sex'=>'男'
];
var_dump($arr2);
echo '<br>';
echo $arr2['name'] . '-' . $arr2['sex'] . '-' . $arr2['age'];//tom-男-18

echo '<hr>';

$arr3=array(
    0=>1,
    1=>5,
    3=>6
);
var_dump($arr3);
echo '<hr>';
var_dump(count($arr3));
echo '<hr>';
for($i=0;$i<count($arr3);$i++){
    echo $arr3[$i] . ' ';
}
echo '<hr>';

foreach($arr3 as $key => $value){
    echo $key . '=' . $value . '<br>';
    // echo "<div>${key}=${value}</div>";
}

echo '<hr>';
$arr4=[
    ["床","前","明","月","光"],
    ["疑","是","地","上","霜"],
    ["举","头","望","明","月"],
    ["低","头","思","故","乡"]
];
$arr5=[
    ["烟","笼","寒","水","月","笼","沙"],
    ["夜","泊","秦","淮","近","酒","家"],
    ["商","女","不","知","亡","国","恨"],
    ["隔","江","犹","唱","后","庭","花"]
];
for($i=0;$i<count($arr4[0]);$i++){
    for($j=count($arr4)-1;$j>=0;$j--){
        echo $arr4[$j][$i];
    }
    echo '<br>';
}
echo '<hr>';
for($i=0;$i<count($arr5[0]);$i++){
    for($j=count($arr5)-1;$j>=0;$j--){
        echo $arr5[$j][$i];
    }
    echo '<br>';
}




?>